function schoolList() {
    $('#citySel').html('');
    for (var i=0; i<cityArr.length; i++) {
        var ctarid = cityArr[i].id
        $('#citySel').append(`
        <option value=${cityArr[i].id} onclick="tableList()">${cityArr[i].name}</option>
        `);
    }
}
schoolList();


function tableList() {
    
    $('tbody').html('');

    for (var i=0; i<schoolArr.length; i++) {
		//选择的城市id
        var selectCityNo = $("#citySel option:selected")[0].value;

        //某个城市的所有学校
        var CitySchoolArr = schoolArr.filter(item => item.cityNo === selectCityNo);
                //某个城市所有学校的id
        var CitySchoolID = CitySchoolArr[i].id;

        //某个学校里网脉班级组成的数组
        var schoolWmbgArr = classArr.filter(item => item.scid === CitySchoolID);

        //某个学校学生组成的数组
        var schoolStudentArr = studentsArr.filter(item => item.schoolNo === CitySchoolID);

        //某个学校学生里会员组成的数组
        var schoolVipArr = schoolStudentArr.filter(item => item.State === "会员");

        $('tbody').append(`
        <tr>
            <td>${CitySchoolArr[i].name}</td>
            <td>${schoolWmbgArr.length}</td>
            <td>${schoolVipArr.length}</td>
            <td>${schoolStudentArr.length - schoolVipArr.length}</td>
        </tr>
        `);
    }
}

